package com.yugao.fintech.antelope.pay.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yugao.fintech.antelope.base.model.BasePO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 商户通知记录表
 * </p>
 *

 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pm_mch_notify_record")
public class MchNotifyRecord extends BasePO implements Serializable {

    // 订单类型:1-支付,2-退款, 3-转账
    public static final String TYPE_PAY_ORDER = "1";
    public static final String TYPE_REFUND_ORDER = "2";
    public static final String TYPE_TRANSFER_ORDER = "3";

    // 通知状态
    public static final String STATE_ING = "1";
    public static final String STATE_SUCCESS = "2";
    public static final String STATE_FAIL = "3";

    public static LambdaQueryWrapper<MchNotifyRecord> lqw(){
        return new LambdaQueryWrapper<>();
    }

    private static final long serialVersionUID=1L;

    /**
     * 商户通知记录ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 订单号, 退款或者支付订单号
     */
    private String orderNo;

    /**
     * 订单类型:1-支付,2-退款
     */
    private String orderType;

    /**
     * 商户订单号
     */
    private String mchOrderNo;

    /**
     * 商户号
     */
    private String mchNo;

    /**
     * 服务商号
     */
    private String isvNo;

    /**
     * 应用ID
     */
    private String appId;

    /**
     * 通知地址
     */
    private String notifyUrl;

    /**
     * 通知响应结果
     */
    private String resResult;

    /**
     * 通知次数
     */
    private Integer notifyCount;

    /**
     * 最大通知次数, 默认6次
     */
    private Integer notifyCountLimit;

    /**
     * 通知状态,1-通知中,2-通知成功,3-通知失败
     */
    private String status;

    /**
     * 最后一次通知时间
     */
    private Date lastNotifyTime;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;


}
